import { VisibilityFilters } from '../actions' // 动作文件的三个变量
// 默认显示全部，可直接写名称，可不引入文件
const visibilityFilter = (state = VisibilityFilters.SHOW_ALL, action) => {
  switch (action.type) {
    case 'SET_VISIBILITY_FILTER':
      return action.filter // 返回用户传入的参数常量.
    default:
      return state // 默认显示全部
  }
}

export default visibilityFilter
